// 类定义测试
class Animal {
    constructor(name) {
        this.name = name;
    }
    
    speak() {
        return this.name + "发出声音";
    }
    
    static info() {
        return "这是Animal类";
    }
}

console.log("\n类测试:");
const animal = new Animal("小动物");
console.log(animal.name);
console.log(animal.speak());
console.log(Animal.info());

// 类继承测试
class Dog extends Animal {
    constructor(name, breed) {
        super(name);
        this.breed = breed;
    }
    
    speak() {
        return this.name + "汪汪叫";
    }
    
    getBreed() {
        return this.breed;
    }
}

console.log("\n继承测试:");
const dog = new Dog("小狗", "哈士奇");
console.log(dog.name);
console.log(dog.breed);
console.log(dog.speak());
console.log(dog.getBreed()); 